{% extends 'TopxiaWebBundle::bootstrap-modal-layout.html.twig' %}

{% set modalSize = 'large' %}
{% set categoriesFirst = data('Categories',{'group':'course'})%}
{% block title %}{% if config.title %}{{ config.title }}{% else %}{{ config.defaultTitle }}{% endif %}{{'编辑'|trans}}{% endblock %}
{% block body %}
    <form id="edit-left-course-form" class="form-horizontal item-config-form" role="form">
      {% block custom_name %}
        <div class="row form-group">
          <div class="col-md-3 control-label">
            <label for="name">{{'自定义名称'|trans}}</label>
          </div>
          <div class="col-md-7 controls">
            <input type="text"  class="form-control" name="title">
          </div>
        </div>
      {% endblock %}

      {% block custom_sub_title %}
        <div class="row form-group">
          <div class="col-md-3 control-label">
            <label for="subname">{{'副标题名称'|trans}}</label>
          </div>
          <div class="col-md-7 controls">
            <input type="text"  class="form-control" name="subTitle">
          </div>
        </div>
      {% endblock %}

      {% block custom_count %}
        <div class="form-group">
          <label class="col-sm-3 control-label">{{'课程数量设置'|trans}}</label>
          <div class="col-sm-4">
            <select class="form-control width-input-large" name="count">
              <option value="4">4</option>
              <option value="8">8</option>
              <option value="12">12</option>
            </select>
          </div>
        </div>
      {% endblock %}

      {% block custom_category_count %}
        <div class="form-group">
          <label class="col-sm-3 control-label">{{'课程分类数量设置'|trans}}</label>
          <div class="col-sm-4">
            <select class="form-control width-input-large" name="categoryCount">
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
            </select>
          </div>
        </div>
      {% endblock %}

      {% block custom_orderby %}
        <div class="form-group">
          <label class="col-md-3 control-label">{{'排序设置'|trans}}</label>
          <div class="col-md-4 controls">
            <select id="orderBy" name="orderBy" required="required" class="form-control width-input width-input-large">
                <option value="latest">{{'最新'|trans}}</option>
                <option value="studentNum">{{'最热'|trans}}</option>
                <option value="recommendedSeq">{{'推荐'|trans}}</option>
            </select>
            <div class="help-block" style="display:none;"></div>
          </div>
        </div>
      {% endblock %}

      {% block custom_background_color %}
        <div class="form-group">
          <label class="col-sm-3 control-label">{{'背景颜色设置'|trans}}</label>
          <div class="col-sm-9 check-box">
          <input type="hidden"  name="background" value={{config.background|default("")}}>
            <label class="radio-inline">
              <input type="radio"  value="section-gray"{% if config.background|default("") == "section-gray"%} checked="checked"{% endif %}>
              {{'灰色'|trans}}
            </label>
            <label class="radio-inline" >
              <input type="radio"  value="section-wihte"{% if config.background|default("") == "section-wihte"%} checked="checked"{% endif %} >
              {{'白色'|trans}}
            </label>
            <label class="radio-inline" >
              <input type="radio"  value=""{% if config.background|default("") == ""%} checked="checked"{% endif %} >
              {{'默认'|trans}}
            </label>
          </div>
        </div>
      {% endblock %}
    </form>

{% endblock %}
{% block footer %}
  <button data-submiting-text="{{'正在保存'|trans}}" class="btn btn-primary pull-right" data-form="#edit-left-course-form" id="save-btn">{{'确定'|trans}}</button>
  <button type="button" class="btn btn-link pull-right" data-dismiss="modal">{{'取消'|trans}}</button>
  <script>app.load('topxiawebbundle/controller/theme/left-edit-modal')</script>
{% endblock %}